diff --git a/CHANGELOG b/CHANGELOG
index a0fc00f..900c2f1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,13 @@
 Changes since U-Boot 0.3.1:
 ======================================================================
 
+* * Patch by Richard Woodruff, 19 June 03:
+  - Fixed smc91c111 driver to sync with the u-boot environment (driver/smc91c111.c).
+  - Added eth_init error return check in NetLoop (net/net.c).
+
+* Patch by Ken Chou, 17 June 2003:
+  Added support for A3000 SBC board (Artis Microsystems Inc.)
+
 * Patches by Murray Jensen, 17 Jun 2003:
   - Hymod board database mods: add "who" field and new xilinx chip types
   - provide new "init_cmd_timeout()" function so code external to
diff --git a/CREDITS b/CREDITS
index 21e4b76..756acca 100644
--- a/CREDITS
+++ b/CREDITS
@@ -66,6 +66,10 @@
 E: jonathan.debruyne@siemens.atea.be
 D: Port to Siemens IAD210 board
 
+N: Ken Chou
+E: kchou@ieee.org	
+D: Support for A3000 SBC board
+
 N: Conn Clark
 E: clark@esteem.com
 D: ESTEEM192E support
diff --git a/drivers/smc91111.c b/drivers/smc91111.c
index 748830e..f29a8a4 100644
--- a/drivers/smc91111.c
+++ b/drivers/smc91111.c
@@ -52,6 +52,7 @@
  .    o   skeleton.c by Donald Becker ( becker@cesdis.gsfc.nasa.gov )
  .
  . History:
+ .      06/19/03  Richard Woodruff Made u-boot environment aware and added mac addr checks. 
  .	10/17/01  Marco Hasewinkel Modify for DNP/1110
  .	07/25/01  Woojung Huh      Modify for ADS Bitsy
  .	04/25/01  Daris A Nevil    Initial public release through SMSC
@@ -176,7 +177,7 @@
  . The kernel calls this function when someone wants to use the device,
  . typically 'ifconfig ethX up'.
 */
-static int smc_open(void);
+static int smc_open(bd_t *bd);
 
 
 /*
@@ -199,7 +200,12 @@
 */
 static int smc_rcv(void);
 
-
+/* See if a MAC address is defined in the current environment. If so use it. If not
+ . print a warning and set the environment and other globals with the default.  
+ . If an EEPROM is present it really should be consulted.
+*/
+int smc_get_ethaddr(bd_t *bd);
+int get_rom_mac(char *v_rom_mac);
 
 /*
  ------------------------------------------------------------
@@ -226,7 +232,7 @@
 
 /*
  * smc_get_macaddr is no longer used. If you want to override the default
- * mac address, call smc_get_mac_addr as a part of the board initialisation.
+ * mac address, call smc_get_mac_addr as a part of the board initialization.
  */
 
 #if 0
@@ -665,14 +671,13 @@
  * Set up everything, reset the card, etc ..
  *
  */
-static int smc_open()
+static int smc_open(bd_t *bd)
 {
-	int	i;	/* used to set hw ethernet address */
+	int	i, err;
 
 	PRINTK2("%s:smc_open\n", SMC_DEV_NAME);
 
 	/* reset the hardware */
-
 	smc_reset();
 	smc_enable();
 
@@ -681,12 +686,16 @@
 	smc_phy_configure();
 #endif
 
-
 	/* conservative setting (10Mbps, HalfDuplex, no AutoNeg.) */
 /*	SMC_SELECT_BANK(0); */
 /*	SMC_outw(0, RPC_REG); */
-
 	SMC_SELECT_BANK(1);
+  
+    err = smc_get_ethaddr(bd); /* set smc_mac_addr, and sync it with u-boot globals */
+    if(err < 0){   
+        memset(bd->bi_enetaddr, 0, 6);  /* hack to make error stick! upper code will abort if not set*/
+        return(-1);                     /* upper code ignores this, but NOT bi_enetaddr */
+    }
 
 #ifdef USE_32_BIT
 	for ( i = 0; i < 6; i += 2 ) {
@@ -1385,8 +1394,7 @@
 #endif
 
 int eth_init(bd_t *bd) {
-	smc_open();
-	return 0;
+	return (smc_open(bd));
 }
 
 void eth_halt() {
@@ -1401,4 +1409,74 @@
 	return smc_send_packet(packet, length);
 }
 
+int smc_get_ethaddr(bd_t *bd)
+{
+    int env_size, rom_valid, env_present = 0, reg;
+    char *s = NULL, *e, *v_mac, es[] = "11:22:33:44:55:66";
+    uchar s_env_mac[64], v_env_mac[6], v_rom_mac[6]; 
+
+    env_size = getenv_r ("ethaddr", s_env_mac, sizeof (s_env_mac)); 
+    if ((env_size > 0) && (env_size < sizeof(es))) {  /* exit if env is bad */
+        printf("\n*** ERROR: ethaddr is not set properly!!\n");
+        return(-1);
+    }
+    
+    if(env_size > 0){
+        env_present = 1;
+        s = s_env_mac;
+    }
+        
+    for (reg = 0; reg < 6; ++reg) {     /* turn string into mac value */
+        v_env_mac[reg] = s ? simple_strtoul (s, &e, 16) : 0; 
+        if (s)                                                  
+            s = (*e) ? e + 1 : e;                               
+    }
+                                                                    
+    rom_valid = get_rom_mac(v_rom_mac); /* get ROM mac value if any */   
+    
+    if(!env_present){                   /* if NO env */
+        if(rom_valid){                  /* but ROM is valid */
+            v_mac = v_rom_mac;
+            sprintf (s_env_mac, "%02X:%02X:%02X:%02X:%02X:%02X", v_mac[0], 
+                     v_mac[1] ,v_mac[2], v_mac[3],v_mac[4], v_mac[5]) ;
+            setenv ("ethaddr", s_env_mac); 
+        }else{                          /* no env, bad ROM */
+            printf("\n*** ERROR: ethaddr is NOT set !!\n");
+            return(-1);
+        }
+    }else                               /* good env, don't care ROM */
+      v_mac = v_env_mac;                /* always use a good env over a ROM */
+   
+    if(env_present && rom_valid)        /* if both env and ROM are good */
+        if(memcmp(v_env_mac, v_rom_mac, 6) != 0){
+            printf("\n*** Warning: Environment and ROM MAC addresses don't match\n");
+            printf("***          Using Environment MAC\n");
+        }
+    memcpy (bd->bi_enetaddr, v_mac, 6); /* update global address to match env (allows env changing) */
+    smc_set_mac_addr(v_mac);            /* use old function to update smc default */
+    return(0);
+}
+
+int get_rom_mac(char *v_rom_mac)
+{
+    int is_rom_present = 0;
+#ifdef HARDCODE_MAC  /* used for testing or to supress run time warnings */    
+    char hw_mac_addr[] = {0x02, 0x80, 0xad, 0x20, 0x31, 0xb8};
+
+    memcpy (v_rom_mac, hw_mac_addr, 6);
+    return(1);
+#else
+    if(is_rom_present)
+    {
+        /* if eeprom contents are valid
+         *   extract mac address into hw_mac_addr, 8 or 16 bit accesses
+         *   memcpy (v_rom_mac, hc_mac_addr, 6); 
+         *   return(1);
+         */  
+    }        
+    memset(v_rom_mac, 0, 6);
+    return(0);
+#endif
+}
+
 #endif /* CONFIG_DRIVER_SMC91111 */
diff --git a/net/net.c b/net/net.c
index 4758595..3081829 100644
--- a/net/net.c
+++ b/net/net.c
@@ -251,7 +251,8 @@
 	}
 
 	eth_halt();
-	eth_init(bd);
+	if(eth_init(bd) < 0)
+	    return(-1);
 
 restart:
 #ifdef CONFIG_NET_MULTI
